package cn.hongyu.aop;

import org.aspectj.lang.ProceedingJoinPoint;

/*
切面类 里边有切点
 */
public class MyAspect {
    public void before(){
        System.out.println("before前置通知.......");
    }
    public void after(){
        System.out.println("after最终通知............");
    }
    public void afterReturning(){
        System.out.println("afterReturning后置通知......");
    }
    public void afterThrowing(){
        System.out.println("afterThrowing异常抛出通知......");
    }
    //ProceedingJoinPoint pjp正在执行的连接点
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("around前环绕通知......");
        Object proceed = pjp.proceed();
        System.out.println("around后环绕通知......");
        return proceed;
    }
}
